home *** CD-ROM | disk | FTP | other *** search
- 10 rem solving knees calhoon's crypto challenge from loadstar 156
- 20 rem tom lawless / 229 dogwood lane / maynardville, tn 37807 / june 1997
- 30 poke53771,0:rem 20mhz if supercpu
- 40 c$=chr$(147):h$=chr$(19):b$=chr$(31):r$=chr$(28):o$=chr$(18):f$=chr$(146)
- 50 d$=chr$(17):u$=chr$(145):l$=chr$(157):i$=chr$(29):a$="":j$="":z$=""
- 60 g$=r$+"[184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184]"+b$:e$=r$+"[185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185]"+b$
- 70 m$="-------------------":s$=o$+" "
- 80 n$="----------- ---------- -----------":print c$chr$(14);
- 90 poke 53280,15:poke 53281,15:d=230:dim c(39):for k=1 to 39:c(k)=-1:next
- 100 dim i(d),n(d),o(d),t(d),w(d),l(d),v(d),f(d),s(d),x(d),g(d),h(d),r(d),u(d)
- 110 :
- 120 print r$"[184]"g$g$,b$" 1. [207]+[206]+[197] = 1 [211][207][204][214][201][206][199]"
- 130 print m$" [203][206][197][197][211][160][195][193][204][200][207][207][206]'[211]"
- 140 print" 2. [212]+[215]+[207] = 2 [195][210][217][208][212][207][160][195][200][193][204][204][197][206][199][197]",m$i$e$
- 150 print" 3. [212]+[200]+[210]+[197]+[197] = 3 "s$,f$m$i$o$" [211]olve this system "
- 160 print" 4. [198]+[207]+[213]+[210] = 4 "s$,f$m$i$o$" of equations over "
- 170 print" 5. [198]+[201]+[214]+[197] = 5 "s$,f$m$i$o$" the integers from "
- 180 print" 6. [211]+[201]+[216] = 6 "s$,f$m$i$o$" -19 to 19, inclu- "
- 190 print" 7. [211]+[197]+[214]+[197]+[206] = 7 "s$,f$m$i$o$" sive, with no two "
- 200 print" 8. [197]+[201]+[199]+[200]+[212] = 8 "s$,f$m$i$o$" variables having "
- 210 print" 9. [206]+[201]+[206]+[197] = 9 "s$,f$m$i$o$" the same value. "
- 220 print"10. [212]+[197]+[206] = 10 "s$,f$m$i$g$
- 230 print"11. [197]+[204]+[197]+[214]+[197]+[206] = 11 "r$"<[195]> [195]ontinue"b$
- 240 print m$"- "r$"<[208]> [208]rint"b$
- 250 print"12. [212]+[215]+[197]+[204]+[214]+[197] = 12 "r$"<[212]> [212]ab 40 [208]rint"b$
- 260 print e$r$"[185] <[209]> [209]uit"b$h$:gosub 5000
- 270 :
- 490 rem method
- 500 print c$tab(17)"[205][197][212][200][207][196]":print i$e$e$,i$s$s$,i$;
- 510 print" 1. [211]elect value of [197]. ([213]ser input) ",i$s$s$,i$;
- 520 print" 2. [212][193][194][204][197] 1: 1 row for each [201] value. ",i$;
- 530 print" [197]valuate [206],[207],[212],[215] on each row. ",i$;
- 540 print" [196]iscard rows w/forbidden values. ",i$s$s$,i$;
- 550 print" 3. [212][193][194][204][197] 2: [213]se all [204] values with ",i$;
- 560 print" each row of [212][193][194][204][197] 1. [197]valuate ",i$;
- 570 print" [214],[198],[211],[216]. [196]iscard rows as before. ",i$s$s$,i$;
- 580 print" 4. [212][193][194][204][197] 3: [213]se all [199] values with ",i$;
- 590 print" each row of [212][193][194][204][197] 2. [197]valuate ",i$;
- 600 print" [200],[210],[213]. [196]iscard rows as before. ",i$s$s$,i$;
- 610 print" 5. [196]isplay solutions. [210]eturn to 1. ",i$s$s$,i$f$g$g$
- 620 print" [197] ="e;tab(8)"<"r$"+"b$"/"r$"-"b$">[211]elect [207]ne [197] [214]alue <"r$"[200]"b$">"
- 630 print" <"r$"\"b$">[211]olve--[212]his [197]--[215]ork [211]creens [200]elp"
- 640 print" <"r$"^"b$">[211]olve--[212]his [197]--[199]auge [211]creen -----"
- 650 print" <"r$"*"b$">[211]olve--[193]ll [197]'s-[199]auge [211]creen <[208]/[212]>"
- 660 print" <"r$"_"b$">[193]ssume [211]ummary [196]ata--[212]his [197] <[209]>"u$u$u$u$
- 670 poke 650,128
- 680 get q$:if q$="q" then 40000
- 690 if q$="p"or q$="t"then gosub 9000:goto 680
- 695 if q$="h" then gosub 4000:goto 500
- 700 if q$="\"then c=0:goto 830
- 710 if q$="^"then c=-1:goto 830
- 720 if q$="*"then c=1:e=-19:goto 830
- 730 if q$<>"_" then 790
- 740 poke 53280,3:poke 53281,3
- 750 for k=1 to e+20:read z:next:restore
- 760 c=0:goto 2200
- 770 data 0,0,0,0,0,0,6,22,40,77,51,125,125,151,199,226,103,139,199,142
- 780 data 160,92,182,0,122,57,82,125,109,75,63,69,33,18,8,7,1,0,0
- 790 if q$<>"+"and q$<>"-"then 680
- 800 if q$="+"then e=e+1:if e=20 then e=-19
- 810 if q$="-"then e=e-1:if e=-20 then e=19
- 820 print tab(4)u$" "l$l$l$e;b$:goto 680
- 830 poke 650,0:if c=0 then 940
- 840 if c=-1 then 930
- 850 :
- 890 rem table 1
- 900 if c(e+20)=-1 then 930
- 910 if e=19 then poke 53280,7:poke 53281,7:goto 2200
- 920 e=e+1:goto 900
- 930 print c$d$d$r$tab(9)"[197] ="e,,,d$b$"[212][193][194][204][197] 1: "r$"[201] [206] [207] [212] [215]"b$:goto 1060
- 940 print c$;:gosub 3030
- 950 print" 1. [207]+[206] ="1-e:print" 2. [212]+[215]+[207] = 2":print" 3. [212]+[200]+[210] ="3-2*e
- 960 print" 4. [198]+[207]+[213]+[210] = 4":print" 5. [198]+[201]+[214] ="5-e:print" 6. [211]+[201]+[216] = 6"
- 970 print" 7. [211]+[214]+[206] ="7-2*e:print" 8. [201]+[199]+[200]+[212] ="8-e:print" 9. 2[206]+[201] ="9-e
- 980 print"10. [212]+[206] ="10-e:print"11. [204]+[214]+[206] ="11-3*e:print m$l$" "
- 990 print" 9. [206] =("9-e"-[201])/2":print" 1. [207] ="1-e"-[206]"
- 1000 print"10. [212] ="10-e"-[206]":print" 2. [215] = 2-[212]-[207]"
- 1010 print e$l$" ":print o$"[201] _ [206] _ [207] & [212] _ [215] "
- 1020 print o$"[213]se all [201] values: ",,,"-19 < = [201] < = +19 ":print g$l$" "
- 1030 print h$tab(19)r$"[185][185][185] [185][185][185] [185][185][185] [185][185][185] [185][185][185]"b$,tab(19)
- 1040 print o$" [201] "i$" [206] "i$" [207] "i$" [212] "i$" [215] ",tab(19)
- 1050 print f$r$"[184][184][184] [184][184][184] [184][184][184] [184][184][184] [184][184][184]"b$,tab(20)"/ / / / /"u$
- 1060 z=0:for i=-19 to 19
- 1070 n=(9-e-i)/2:if n<-19 or n>19 or n=i or n=e or n<>int(n) then 1120
- 1080 o=1-e-n:if o<-19 or o>19 or o=n or o=i or o=e then 1120
- 1090 t=10-e-n:if t<-19 or t>19 or t=n or t=i or t=e then 1120
- 1100 w=2-t-o:if w<-19 or w>19 or w=n or w=i or w=e then 1120
- 1110 z=z+1:i(z)=i:n(z)=n:o(z)=o:t(z)=t:w(z)=w
- 1120 next
- 1130 if c<>0 then 1200
- 1140 for k=1 to z:print tab(19)i(k)tab(23)n(k)tab(27)o(k)tab(31)t(k)tab(35)w(k)
- 1150 next:print tab(19)m$,tab(19)"[212][193][194][204][197] 1: [193]ll rows"
- 1160 print tab(19)"with invalid values",tab(19)"have been discarded"
- 1170 print tab(19)m$,tab(25)"<[195]> <[208]/[212]> <[209]>":gosub 5000
- 1180 :
- 1190 rem table 2
- 1200 a=1:j=1:if c=0 then 1230
- 1210 print d$"[212][193][194][204][197] 2: "r$"[204] [214] [198] [211] [216]"b$:for k=1to z:print".";:next:print u$
- 1220 print"[162]";:goto 1250
- 1230 gosub 2990:gosub 3020:print tab(21)u$"/ / / / /"
- 1240 gosub 3030:gosub 3040
- 1250 k=j-1:forl=-19to19:ifl=w(j)orl=t(j)orl=o(j)orl=n(j)orl=i(j)or l=e then1350
- 1260 v=11-3*e-n(j)-l:if v<-19 or v>19 or v=l or v=e then 1350
- 1270 if v=w(j) or v=t(j) or v=o(j) or v=n(j) or v=i(j) then 1350
- 1280 f=5-e-i(j)-v:if f<-19 or f>19 or f=v or f=l or f=e then 1350
- 1290 if f=w(j) or f=t(j) or f=o(j) or f=n(j) or f=i(j) then 1350
- 1300 s=7-2*e-n(j)-v:if s<-19 or s>19 or s=f or s=v or s=l or s=e then 1350
- 1310 if s=w(j) or s=t(j) or s=o(j) or s=n(j) or s=i(j) then 1350
- 1320 x=6-i(j)-s:if x<-19 or x>19 or x=s or x=f or x=v or x=l or x=e then 1350
- 1330 if x=w(j) or x=t(j) or x=o(j) or x=n(j) or x=i(j) then 1350
- 1340 k=k+1:l(k)=l:v(k)=v:f(k)=f:s(k)=s:x(k)=x
- 1350 next:if c=0 then 1390
- 1360 gosub 2810:if j<=z then 1220
- 1370 if z=0 then 2200
- 1380 print d$d$:for i=1 to z:print".";:next:print h$d$d$d$d$d$d$d$d$:goto1600
- 1390 if k<j then 1460
- 1400 for i=j to k:x$=left$(str$(x(i)),3):if i<>j+19 then 1440
- 1410 print tab(20)m$,tab(21)"[205]ore <[195]> <[208]/[212]> <[209]>":gosub 5000
- 1420 gosub 2990:gosub 3020:gosub 3030:gosub 3040
- 1430 print tab(20)m$,tab(21)"[195]ontinued",tab(20)m$
- 1440 print tab(20)l(i)tab(24)v(i)tab(28)f(i)tab(32)s(i)tab(36)x$
- 1450 next
- 1460 gosub 2810:if z=0 then 2200
- 1470 gosub 2930:if j<=z then 1230
- 1480 :
- 1490 rem table 2 display
- 1500 for j=1 to z:if (j-1)/20>int((j-1)/20) then 1520
- 1510 gosub 2990:a=j
- 1520 gosub 3020:gosub 3130
- 1530 if j/20>int(j/20) and j<z then 1560
- 1540 b=j:print"-"m$m$,"[197]="e;l$":[212][193][194][204][197] 2:"a"-"b"/"z;tab(28)
- 1550 print r$"<[195]><[208]/[212]><[209]>"u$b$:gosub 5000
- 1560 next
- 1570 :
- 1590 rem table 3
- 1600 a=0:j=1:if c=0 then 1630
- 1610 print"[212][193][194][204][197] 3: "r$"[199] [200] [210] [213]"b$
- 1620 print"[162]";:goto 1720
- 1630 gosub 2990:gosub 3020:gosub 3130:gosub 3030
- 1640 print" 3. [200]+[210] ="3-2*e-t(j):print" 4. [213]+[210] ="4-o(j)-f(j)
- 1650 print" 8. [199]+[200] ="8-e-i(j)-t(j):print m$l$" ",,," 8. [200] ="8-e-i(j)-t(j)"- [199]"
- 1660 print" 3. [210] ="3-2*e-t(j)"- [200]":print" 4. [213] ="4-o(j)-f(j)"- [210]":print e$l$" "
- 1670 print o$" [199] _ [200] _ [210] _ [213] ",,,"-19 < = [199] < = +19 "
- 1680 print o$"[196]iscard rows with ",,,"forbidden values. ":print g$l$" "
- 1690 print h$d$d$d$d$tab(22)r$"[185][185][185] [185][185][185] [185][185][185] [185][185][185]"b$
- 1700 print tab(22)o$" [199] "i$" [200] "i$" [210] "i$" [213] "
- 1710 print tab(22)r$"[184][184][184] [184][184][184] [184][184][184] [184][184][184]"b$,tab(23)"/ / / /"u$
- 1720 k=j-1:forg=-19to19:ifg=x(j)org=s(j)org=f(j)org=v(j)org=l(j)or g=e then1800
- 1725 if g=w(j) or g=t(j) or g=o(j) or g=n(j) or g=i(j) then 1800
- 1730 h=8-e-i(j)-t(j)-g:if h<-19 or h>19 or h=g or h=e then 1800
- 1740 if h=x(j) or h=s(j) or h=f(j) or h=v(j) or h=l(j) then 1800
- 1745 if h=w(j) or h=t(j) or h=o(j) or h=n(j) or h=i(j) then 1800
- 1750 r=3-2*e-t(j)-h:if r<-19 or r>19 or r=h or r=g or r=e then 1800
- 1760 if r=x(j) or r=s(j) or r=f(j) or r=v(j) or r=l(j) then 1800
- 1765 if r=w(j) or r=t(j) or r=o(j) or r=n(j) or r=i(j) then 1800
- 1770 u=4-o(j)-f(j)-r:if u<-19 or u>19 or u=r or u=h or u=g or u=e then 1800
- 1780 if u=x(j) or u=s(j) or u=f(j) or u=v(j) or u=l(j) then 1800
- 1785 if u=w(j) or u=t(j) or u=o(j) or u=n(j) or u=i(j) then 1800
- 1790 k=k+1:g(k)=g:h(k)=h:r(k)=r:u(k)=u
- 1800 next:if c=0 then 1830
- 1810 gosub 2810:if j<=z then 1620
- 1820 goto 1900
- 1830 if k<j then 1850
- 1840 for i=j to k:print tab(22)g(i)tab(26)h(i)tab(30)r(i)tab(34)u(i):next
- 1850 gosub 2810:if z=0 then 2200
- 1860 gosub 2930:if j<=z then 1630
- 1870 :
- 1890 rem solutions
- 1900 if z=0 then 2200
- 1910 a$="a":j$="j":z$="h":for k=1 to z:if (k-1)/7>int((k-1)/7) then 1980
- 1920 t=-1:a=k:print c$d$r$"[185][185][185][185][185][185][185][185] [185][185][185][185][185][185][185][185][185][185][185][185][185][185][185] [185][185][185][185][185][185][185][185][185][185][185]"b$,tab(6)
- 1930 print o$" "tab(23)" "u$,," [197] ="e;tab(10);z;l$" [211]olutions ";
- 1940 print tab(27)" [195]hecked [186] ",f$r$"[184][184][184][184][184][184][184][184] [184][184][184][184][184][184][184][184][184][184][184][184][184][184][184] [184][184][184][184][184][184][184][184][184][184][184]"b$
- 1950 print" [197] =":print" [198] =":print" [199] =":print" [200] =":print" [201] =":print" [204] ="
- 1960 print" [206] =":print" [207] =":print" [210] =":print" [211] =":print" [212] =":print" [213] ="
- 1970 print" [214] =":print" [215] =":print" [216] =":print m$m$
- 1980 t=t+5:print h$d$d$d$d$tab(t)e:print tab(t)f(k):print tab(t)g(k)
- 1990 print tab(t)h(k):print tab(t)i(k):print tab(t)l(k):print tab(t)n(k)
- 2000 print tab(t)o(k):print tab(t)r(k):print tab(t)s(k):print tab(t)t(k)
- 2010 print tab(t)u(k):print tab(t)v(k):print tab(t)w(k):print tab(t)x(k):print
- 2020 if o(k)+n(k)+e<>1 or t(k)+w(k)+o(k)<>2 or t(k)+h(k)+r(k)+e+e<>3 then 2090
- 2030 if f(k)+o(k)+u(k)+r(k)<>4 or f(k)+i(k)+v(k)+e<>5 then 2090
- 2040 if s(k)+i(k)+x(k)<>6 or s(k)+e+v(k)+e+n(k)<>7 then 2090
- 2050 if e+i(k)+g(k)+h(k)+t(k)<>8 or n(k)+i(k)+n(k)+e<>9 then 2090
- 2060 if t(k)+e+n(k)<>10 or e+l(k)+e+v(k)+e+n(k)<>11 then 2090
- 2070 if t(k)+w(k)+e+l(k)+v(k)+e<>12 then 2090
- 2080 print tab(t+1)"[186]":goto 2100
- 2090 print
- 2100 if t<34 and k<z then 2150
- 2110 b=k:print m$m$,"[211]olutions"a"-"b;tab(21)"<[195]> <[208]/[212]/"r$"[193]"b$"ll> <[209]>"
- 2120 print "<"r$"[200]"b$"> [200]elp";tab(21)"<"r$"[202]"b$"ump [212]o [211]ummary>"
- 2130 gosub 5000:if q$="j" then k=z
- 2140 if q$="h" then k=a-1:gosub 4610
- 2150 next:j$="":z$=""
- 2160 :
- 2200 rem solution summary
- 2210 c(e+20)=z:print c$d$e$:print o$" [211]olution [211]ummary ":print g$:print n$
- 2220 k=0:for j=1 to 13:k=k+c(j)+c(j+13)+c(j+26)
- 2230 print"[197] ="j-20;tab(7)r$c(j)b$;:if c(j)=-1 then print l$l$l$" ---";:k=k+1
- 2240 printtab(14)"[197] ="j-7;r$c(j+13)b$;:ifc(j+13)=-1thenprintl$l$l$" ---";:k=k+1
- 2250 print tab(27)"[197] ="j+6;tab(34)r$c(j+26)b$;:if c(j+26)>-1 then 2270
- 2260 print l$l$l$" ---";:k=k+1
- 2270 print:next
- 2280 print n$,e$e$,s$s$,u$" [212]otal [206]umber of [211]olutions ="k,f$g$g$
- 2290 print "<[195]> [195]ontinue <[208]/[212]/[193]> [208]rint <[209]> [209]uit":gosub 5000:a$=""
- 2300 poke 53280,15:poke 53281,15
- 2310 if c=1 and e<19 then e=e+1:goto 900
- 2320 goto 500
- 2330 :
- 2600 rem deletions
- 2610 for i=j to z-1:q=i+1
- 2620 i(i)=i(q):n(i)=n(q):o(i)=o(q):t(i)=t(q):w(i)=w(q):if a then 2640
- 2630 l(i)=l(q):v(i)=v(q):f(i)=f(q):s(i)=s(q):x(i)=x(q)
- 2640 next:return
- 2650 :
- 2700 rem insertions
- 2710 for i=z to j+1 step -1:q=i+k-j
- 2720 i(q)=i(i):n(q)=n(i):o(q)=o(i):t(q)=t(i):w(q)=w(i):if a then 2740
- 2730 l(q)=l(i):v(q)=v(i):f(q)=f(i):s(q)=s(i):x(q)=x(i)
- 2740 next:return
- 2750 for i=j+1 to k
- 2760 i(i)=i(j):n(i)=n(j):o(i)=o(j):t(i)=t(j):w(i)=w(j):if a then 2780
- 2770 l(i)=l(j):v(i)=v(j):f(i)=f(j):s(i)=s(j):x(i)=x(j)
- 2780 next:return
- 2790 :
- 2800 rem shared analysis and print
- 2810 b=1:if k=j then j=j+1:return
- 2820 if k>j then 2880
- 2830 b=0:if j=z then 2850
- 2840 gosub 2610
- 2850 z=z-1:if z>0 then return
- 2860 print:print tab(20)m$d$,tab(26)"[197] ="e,tab(26)"[206]o [211]olution"d$
- 2870 print tab(26)"<[195]> <[208]/[212]> <[209]>":gosub 5000:return
- 2880 if j=z then 2900
- 2890 gosub 2710
- 2900 gosub 2750
- 2910 z=z+k-j:j=k+1:return
- 2920 :
- 2930 if b then print tab(20)m$:goto 2960
- 2940 print tab(20)d$e$,tab(20)o$" [193]ll rows contain "
- 2950 print tab(20)o$" forbidden values. ",tab(20)f$g$
- 2960 if j>z then print tab(23)d$"[206]umber [207]f",tab(23)"[211]uccesses ="z;d$
- 2970 print tab(26)"<[195]> <[208]/[212]> <[209]>":gosub 5000:return
- 2980 :
- 2990 print c$r$"[185][185][185] [185][185][185] [185][185][185] [185][185][185] [185][185][185] [185][185][185] [185][185][185] [185][185][185] [185][185][185] [185][185][185]"b$o$,
- 3000 print" [201] "i$" [206] "i$" [207] "i$" [212] "i$" [215] "i$" [204] "i$" [214] "i$" [198] "i$" [211] "i$" [216] "
- 3010 print r$"[184][184][184] [184][184][184] [184][184][184] [184][184][184] [184][184][184] [184][184][184] [184][184][184] [184][184][184] [184][184][184] [184][184][184]"b$:return
- 3020 print i(j);tab(4)n(j);tab(8)o(j);tab(12)t(j);tab(16)w(j):return
- 3030 print e$l$" ",,,tab(16)o$" "u$,,,"[197]quations [197] ="e,,,f$g$l$" ":return
- 3040 print" 3. [200]+[210] ="3-2*e-t(j):print" 4. [198]+[213]+[210] ="4-o(j)
- 3050 print" 5. [198]+[214] ="5-e-i(j):print" 6. [211]+[216] ="6-i(j)
- 3060 print" 7. [211]+[214] ="7-2*e-n(j):print" 8. [199]+[200] ="8-e-i(j)-t(j)
- 3070 print"11. [204]+[214] ="11-3*e-n(j):print m$l$" ":print"11. [214] ="11-3*e-n(j)"-[204]"
- 3080 print" 5. [198] ="5-e-i(j)"-[214]":print" 7. [211] ="7-2*e-n(j)"-[214]"
- 3090 print" 6. [216] ="6-i(j)"-[211]"
- 3100 print e$l$" ":print o$"[204] _ [214] _ [198] & [211] _ [216] ",,,"-19 < = [204] < = +19 "
- 3110 print o$"[196]iscard rows with ",,,"forbidden values. ":print g$l$" "h$d$d$
- 3120 return
- 3130 x$=left$(str$(x(j)),3)
- 3140 print u$tab(20)l(j);tab(24)v(j);tab(28)f(j);tab(32)s(j);tab(36)x$:return
- 3150 :
- 3990 rem method help screen 1
- 4000 poke 53280,7:poke 53281,7:print c$tab(12)"[205]ethod:[200]elp 1(3)"
- 4010 print r$"[184][184]"g$g$"[212]he "r$"[195]"b$" key is used to advance the program";
- 4020 print"on all screens except the [205][197][212][200][207][196] screen.[193]ctions there";
- 4030 print" are initiated by "r$"\ ^ * _"b$". --"m$m$;
- 4040 print"<"r$"\"b$"> [212]he [215]ork [211]creens allow you to view"
- 4050 print"and print the steps of the solution.","--"m$m$;
- 4060 print"<"r$"^"b$"><"r$"*"b$"> [212]he [199]auge [211]creen produces faster"
- 4070 print"solutions, showing final results only. --"m$m$;
- 4080 print"<"r$"*"b$"> [211]olve--[193]ll [197]'s automatically assigns";
- 4090 print"the next unused [197] for solving after each";
- 4100 print"solution screen and summary are cleared.--"m$m$;
- 4110 print"<"r$"_"b$"> [193]ssume [211]ummary [196]ata for [197]'s solved"
- 4120 print"on earlier runs of the program. <"r$"*"b$"> will";
- 4130 print"then not re-solve with those [197] [214]alues. --"m$m$;
- 4140 print"<"r$"+"b$"><"r$"-"b$"> [201]ncrease or [196]ecrease the value of";
- 4150 print"[197]. [212]he value showing is used by "r$"\ ^ _"b$". "r$"[185][185]"e$e$
- 4160 print"<[195]> [195]ontinue <[208]/[212]> [208]rint <[209]> [209]uit";:gosub 5000
- 4170 :
- 4180 rem method help screen 2
- 4190 poke 53280,7:poke53281,7:print c$" [205]ethod:[200]elp 2. [215]hy not test them all?"
- 4200 print i$e$e$,i$s$s$,i$" [212]he rules permit 39*38*37*...*26*25 ",i$;
- 4210 print" permutations of the variable values. ",i$s$s$,i$;
- 4220 print" = 32,876,032,900,000,000,000,000 = ",i$s$s$,i$;
- 4230 print" [195]omputers testing a million of these ",i$;
- 4240 print" each second would require more than ",i$;
- 4250 print" a billion years to test them all. ",i$s$s$f$,i$g$g$d$
- 4260 print" [197]quation 12 may be discarded since it"
- 4270 print" is derivable from equations 1,2, & 11.",i$m$m$
- 4280 print r$" [197]q.2 + [197]q.11 - [197]q.1 _ [197]q.12"b$:print i$m$m$
- 4290 print" ([212]+[215]+[207])+([197]+[204]+[197]+[214]+[197]+[206])-([207]+[206]+[197]) = 2+11-1"
- 4300 print" [212]+[215]+[207] + [197]+[204]+[197]+[214]+[197]+[206] - [207]-[206]-[197] = 12"
- 4310 print" [212]+[215] + [197]+[204] +[214]+[197] = 12",i$m$m$
- 4320 print" <[195]> [195]ontinue <[208]/[212]> [208]rint <[209]> [209]uit":gosub 5000
- 4330 :
- 4340 rem method help screen 3
- 4350 poke 53280,7:poke 53281,7:print c$"[205]ethod:[200]elp 3 ";:q$=left$(m$,13)
- 4360 print r$"([213]se [193]ll [201])"b$" [201] [206] [207] [212] [215]",q$tab(26)q$
- 4370 print" 9. [206]=(9-[197]-[201])/2 "r$"[212]able /"b$"-19 - - - -"
- 4380 print" 1. [207]=1-[197]-[206] "r$"[207]ne /"b$" -18 -[214]alues -"
- 4390 print"10. [212]=10-[197]-[206] "r$"/"b$" . -[198]rom - -"
- 4400 print" 2. [215]=2-[212]-[207] "r$"/"b$" . -[197]quations"
- 4410 print r$" [208]ick [207]ne [197]......."b$"[197]"r$"[164][164][164]"b$"+19 - - - - -"m$m$
- 4420 print tab(14)r$"([213]se [193]ll [204]) "b$"[204] [214] [198] [211] [216]","11. [214]=11-3[197]-[206]-[204]"tab(26)q$
- 4430 print" 5. [198]=5-[197]-[201]-[214] "r$"[212]able /"b$"-19 - - - -"
- 4440 print" 7. [211]=7-2[197]-[206]-[214] "r$"[212]wo /"b$" -18 -[214]alues -"
- 4450 print" 6. [216]=6-[201]-[211] "r$"/"b$" . -[198]rom - -"
- 4460 print r$"[204]ine [198]rom"tab(21)"/"b$" . -[197]quations"
- 4470 print r$"[212]able [207]ne.."b$"[197]:[201]:[206]:[207]:[212]:[215]"r$"[164][164][164]"b$"+19 - - - - -"m$m$
- 4480 print tab(17)r$"([213]se [193]ll [199]) "b$"[199] [200] [210] [213]"
- 4490 print" 8. [200]=8-[197]-[201]-[212]-[199]"tab(29)"----------"
- 4500 print" 3. [210]=3-2[197]-[212]-[200] "r$"[212]able /"b$"-19 - - -"
- 4510 print" 4. [213]=4-[207]-[198]-[210] "r$"[212]hree /"b$" -18 -[214]alues"
- 4520 print tab(25)r$"/ "b$". -[198]rom -"
- 4530 print r$"[204]ine [198]rom [212]able [212]wo / "b$". -[197]qs. -"
- 4540 print r$" ..."b$"[197]:[201]:[206]:[207]:[212]:[215]:[204]:[214]:[198]:[211]:[216]"r$"[164][164][164]"b$"+19 - - - -"m$m$
- 4550 print"<[195]> [195]ontinue <[208]/[212]> [208]rint <[209]> [209]uit";:gosub 5000
- 4560 poke 53280,15:poke 53281,15:return
- 4570 :
- 4600 rem solution help screen
- 4610 poke 53280,7:poke 53281,7
- 4620 print c$d$r$"[184][184]"g$g$"[212]here are two special commands available";
- 4630 print"on the [211]olutions [196]isplay [211]creens:<"r$"[193]"b$"><"r$"[202]"b$">.--"m$m$;
- 4640 print"<"r$"[193]"b$"> [208]rint [193]ll of the solutions for the"
- 4650 print"current [197] value. ("r$"[193]"b$" is also hot on the"
- 4660 print"[211]ummary [211]creen--current [197] value.) "r$"[208]"b$" & "r$"[212]"b$
- 4670 print"continue to print the screen contents. --"m$m$;
- 4680 print"<"r$"[202]"b$"> [202]ump. [211]kip the on-screen display of"
- 4690 print"solutions. "r$"[195]"b$" continues the normal screen";
- 4700 print"display, which includes the "r$"[186]"b$" routine."
- 4710 print"("r$"[193]"b$" & "r$"[202]"b$" are the quick way to copy current";
- 4720 print"solutions and begin the next solution.) --"m$m$;
- 4730 print"[212]he checking routine prints a "r$"[186]"b$" only if"
- 4740 print"the values check in all twelve equations";
- 4750 print"(lines 2020-2090.) [201]f the program and"
- 4760 print"algorithm are error free, all solutions"
- 4770 print"produced must check. [212]he "r$"[186]"b$" routine has"
- 4780 print"been verified with good and bad data. "r$"[185][185]"e$e$
- 4790 print"<[195]> [195]ontinue <[208]/[212]> [208]rint <[209]> [209]uit";
- 4800 gosub 5000:poke 53280,15:poke 53281,15:return
- 4810 :
- 5000 rem check keypress
- 5010 get q$:if q$="" then 5010
- 5020 if q$="q" then 40000
- 5030 if q$="p" or q$="t" or q$=a$ then gosub 9000:goto 5010
- 5040 if q$<>"c" and q$<>j$ and q$<>z$ then 5010
- 5050 return
- 5060 :
- 9000 rem printer
- 9010 poke 53280,0:poke 53281,0:open1,4,7:close 1:if st<>0 then 9210
- 9020 open 1,4,7:if q$="a" then 9110
- 9030 t$="":if q$="t" then t$=" "
- 9040 print#1,t$;:for m=1 to 39:print#1,"[164]";:next:print#1
- 9050 for y=0 to 24:print#1,t$;
- 9060 for m=0 to 39:p=peek(40*y+m+1024):if p>127 then p=p-128
- 9070 if p>95 or p<32 then p=p+64:goto 9090
- 9080 if p>63 then p=p+32
- 9090 print#1,chr$(p);:next:print#1:next
- 9100 print#1,t$;:for m=1 to 39:print#1,"[163]";:next:print#1:goto 9200
- 9110 print#1," [197] [198] [199] [200] [201] [204] [206]";
- 9120 print#1," [207] [210] [211] [212] [213] [214] [215] [216]"
- 9130 print#1," ";:for m=1 to 15:print#1," ---";:next:print#1
- 9140 for m=1 to z:x=m:gosub9220:x=e:gosub9220:x=f(m):gosub9220:x=g(m):gosub9220
- 9150 x=h(m):gosub9220:x=i(m):gosub9220:x=l(m):gosub9220:x=n(m):gosub9220
- 9160 x=o(m):gosub9220:x=r(m):gosub9220:x=s(m):gosub9220:x=t(m):gosub9220
- 9170 x=u(m):gosub9220:x=v(m):gosub9220:x=w(m):gosub9220:x=x(m):gosub9220
- 9180 print#1:next
- 9190 print#1," ";:for m=1 to 15:print#1," ---";:next:print#1
- 9200 close 1
- 9210 poke 53280,15:poke 53281,15:return
- 9220 print#1,left$(" "+str$(x)+" ",5);:return
- 9230 :
- 10000 d=peek(186):n$="b.crypto sol":open15,d,15,"s0:"+n$:close15:saven$,d:end
- 40000 poke650,0
- 40002 fori=8to29:poke820+i,i:next:ifdv>8anddv<30thenpoke828,dv:poke820+dv,8
- 40010 a$="presenter":gosub40030:a$="hello connect":gosub40030
- 40020 print"[147]":poke53272,23:poke186,8:poke2048,0:poke44,8:poke43,1:end
- 40030 forj=8to29:i=peek(820+j):ifi=14thennext
- 40040 close2:open2,i,2:close2:ifstthen40060
- 40050 close15:open15,i,15,"r0:"+a$+"="+a$:input#15,er:close15:ifer=63then40070
- 40060 next:return
- 40070 a$="hello connect":q$=chr$(34):poke646,peek(53281):print"[147]":poke53272,23
- 40080 print"[147]p[207]2048,0:p[207]44,8:p[207]43,1:p[207]56,160:p[207]55,0:clr:l[207]"q$a$q$","i
- 40090 print"run:":poke631,13:poke632,13:poke198,2:end
-